import request from '@/utils/request'

const api_name = '/admin/product/categoryBrand'

// 分页列表
export const GetCategoryBrandPageList = (page, limit, searchObj) => {
    return request({
        url: `${api_name}/pageInfo/${page}/${limit}`,
        method: 'get',
        params: searchObj,
    })
}

// 保存信息
export const SaveCategoryBrand = categoryBrand => {
    return request({
      url: `${api_name}/save`,
      method: 'post',
      data: categoryBrand,
    })
}

// 根据分类的id获取品牌数据
export const FindBrandByCategoryId = categoryId => {
    return request({
      url: `${api_name}/findBrandByCategoryId/${categoryId}`,
      method: 'get',
    })
}


//删除
export const DeleteCategoryBrand = (roleId) =>{
  return request({
    // ``模板字符串
    url: `${api_name}/delete/${roleId}`, //路径
    method: 'delete' //提交方式
  })
}


//修改
export const UpdateCategoryBrand = (sysRole) =>{
  return request({
    // ``模板字符串
    url: `${api_name}/update`, //路径
    method: 'put', //提交方式
    data: sysRole, //其他参数
  })
}